<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
    <title>广西水电报名系统</title>

    <!-- CSS  -->
    <!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">-->
    <link href="/bm/Public/css/Mi.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/bm/Public/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/bm/Public/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body>
<nav class="blue" role="navigation">
    <div class="nav-wrapper container"><a id="logo-container" href="<?php echo U('Index/index');?>" class="brand-logo">广西水电报名系统</a>
        <ul class="right hide-on-med-and-down">
            <li><a href="<?php echo U('Index/index');?>">首页</a></li>
            <?php if(session('?username')): ?><li><a href="index.html"><?php echo ($_SESSION["username"]); ?></a></li><li><a href="<?php echo U('UserInfo/index');?>">报名详情</a></li><li><a class="waves-effect waves-light btn red" href="<?php echo U('Login/logout');?>">退出</a></li>
                <?php else: ?> <li><a class="waves-effect waves-light btn red" href="<?php echo U('Login/index');?>">登录</a></li><?php endif; ?>
        </ul>
        <ul id="nav-mobile" class="side-nav">
            <li><a href="<?php echo U('Index/index');?>">首页</a></li>

            <?php if(session('?username')): ?><li><a href="#"><?php echo ($_SESSION["username"]); ?></a></li><li><a href="<?php echo U('UserInfo/index');?>">报名详情</a></li><li><a href="<?php echo U('Login/logout');?>">退出</a></li>
                <?php else: ?> <li><a href="<?php echo U('Login/index');?>">登录</a></li><?php endif; ?>
        </ul>
        <a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
    </div>
</nav>


<div class="container">
    <div class="section" id="mysec">
        <?php if(is_array($res)): $i = 0; $__LIST__ = $res;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="row">

                <div class="col s12">
                    <div class="card-panel hoverable">
                        <div class="">
                            <div class="left"><h4><a href="details.html"><?php echo ($vo["title"]); ?></a></h4></div>
                            <div class="right" style="margin-top: 20px;">截止时间：<span
                                    class="center-aligne" style="color: red"><?php echo ($vo["start"]); ?>~<?php echo ($vo["end"]); ?></span></div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="valign">
                            <p>&emsp;&emsp;<?php echo mb_substr($vo["content"],0,140); ?>
                                ……
                            </p>
                        </div>

                        <div class="left" style="color: gray">发布时间：<span
                                class="mui--divider-right"><?php echo ($vo["addtime"]); ?>&nbsp;</span>&nbsp;报名人数：<span><?php echo (sumPeo($vo["title"])); ?>/<?php echo ($vo["num"]); ?></span>
                        </div>

                        <div class="right">
                            <?php if(sumPeo($vo['title']) < $vo['num'] ): if(time() < strtotime($vo['end']) ): ?><a
                                        class="waves-effect waves-light btn red"
                                        href="<?php echo U('Stuform/index',array('title'=>$vo['title']));?>">报名</a>
                                    <?php else: ?>
                                    <a class="waves-effect waves-light btn disabled red">报名已过期</a><?php endif; ?>
                                <?php else: ?>
                                <a class="waves-effect waves-light btn disabled red">报名已满</a><?php endif; ?>

                            <a class="waves-effect waves-light btn green"
                               href="<?php echo U('Details/index',array('id'=>$vo['id']));?>">查看详情</a>
                        </div>
                        <div class="clearfix"></div>


                    </div>
                </div>
            </div><?php endforeach; endif; else: echo "" ;endif; ?>


        <ul class="pagination center">
            <!--<li class="disabled"><a href="#!"><i class="material-icons">chevron_left</i></a></li>-->
            <!--<li class="active"><a href="#!">1</a></li>-->
            <!--<li class="waves-effect"><a href="#!">2</a></li>-->
            <!--<li class="waves-effect"><a href="#!">3</a></li>-->
            <!--<li class="waves-effect"><a href="#!">4</a></li>-->
            <!--<li class="waves-effect"><a href="#!">5</a></li>-->
            <!--<li class="waves-effect"><a href="#!"><i class="material-icons">chevron_right</i></a></li>-->
            <?php echo ($page); ?>
        </ul>
    </div>


</div>

<div class="clearfix"></div>

<footer class="page-footer blue" style="padding-top: 0px;">
    <div class="footer-copyright">
        <div class="container center">
            © 2016 广西水利电力职业技术学院<a class="orange-text text-lighten-3" href="#">敏捷软件协会</a>
        </div>
    </div>
</footer>


<!--  Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="/bm/Public/js/materialize.js"></script>
<script src="/bm/Public/js/init.js"></script>
<script>
    $(document).ready(function () {
        $('select').material_select();
    });
</script>
</body>
</html>

</html>